package com.zhentao.day01;

public class Mth {

 /* public int jiSuan(int num ){
    if (num == 100){
      return 100;
    }
    return  num + jiSuan(++num);
  }*/

  public int jiSuan(int num ){
    if (num == 1){
      return 1;
    }
    return  num + jiSuan(--num);
  }

  public static void main(String[] args) {

    Mth mth = new Mth();

    System.out.println("mth.jiSuan(1) = " + mth.jiSuan(100));

  }
}
